home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsISocketProvider.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  152 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsISocketProvider.idl
  3.  */
  4.  
  5. #ifndef __gen_nsISocketProvider_h__
  6. #define __gen_nsISocketProvider_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsISocketProvider */
  19. #define NS_ISOCKETPROVIDER_IID_STR "00b3df92-e830-11d8-d48e-0004e22243f8"
  20.  
  21. #define NS_ISOCKETPROVIDER_IID \
  22.   {0x00b3df92, 0xe830, 0x11d8, \
  23.     { 0xd4, 0x8e, 0x00, 0x04, 0xe2, 0x22, 0x43, 0xf8 }}
  24.  
  25. /**
  26.  * nsISocketProvider
  27.  */
  28. class NS_NO_VTABLE nsISocketProvider : public nsISupports {
  29.  public: 
  30.  
  31.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISOCKETPROVIDER_IID)
  32.  
  33.   /**
  34.      * newSocket
  35.      *
  36.      * @param aFamily
  37.      *        The address family for this socket (PR_AF_INET or PR_AF_INET6).
  38.      * @param aHost
  39.      *        The hostname for this connection.
  40.      * @param aPort
  41.      *        The port for this connection.
  42.      * @param aProxyHost
  43.      *        If non-null, the proxy hostname for this connection.
  44.      * @param aProxyPort
  45.      *        The proxy port for this connection.
  46.      * @param aFlags
  47.      *        Control flags that govern this connection (see below.)
  48.      * @param aFileDesc
  49.      *        The resulting PRFileDesc.
  50.      * @param aSecurityInfo
  51.      *        Any security info that should be associated with aFileDesc.  This
  52.      *        object typically implements nsITransportSecurityInfo.
  53.      */
  54.   /* void newSocket (in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, out PRFileDescStar aFileDesc, out nsISupports aSecurityInfo); */
  55.   NS_IMETHOD NewSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * *aFileDesc, nsISupports **aSecurityInfo) = 0;
  56.  
  57.   /**
  58.      * addToSocket
  59.      *
  60.      * This function is called to allow the socket provider to layer a
  61.      * PRFileDesc on top of another PRFileDesc.  For example, SSL via a SOCKS
  62.      * proxy.
  63.      *
  64.      * Parameters are the same as newSocket with the exception of aFileDesc,
  65.      * which is an in-param instead.
  66.      */
  67.   /* void addToSocket (in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, in PRFileDescStar aFileDesc, out nsISupports aSecurityInfo); */
  68.   NS_IMETHOD AddToSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * aFileDesc, nsISupports **aSecurityInfo) = 0;
  69.  
  70.   /**
  71.      * PROXY_RESOLVES_HOST
  72.      *
  73.      * This flag is set if the proxy is to perform hostname resolution instead
  74.      * of the client.  When set, the hostname parameter passed when in this
  75.      * interface will be used instead of the address structure passed for a
  76.      * later connect et al. request.
  77.      */
  78.   enum { PROXY_RESOLVES_HOST = 1 };
  79.  
  80. };
  81.  
  82. /* Use this macro when declaring classes that implement this interface. */
  83. #define NS_DECL_NSISOCKETPROVIDER \
  84.   NS_IMETHOD NewSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * *aFileDesc, nsISupports **aSecurityInfo); \
  85.   NS_IMETHOD AddToSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * aFileDesc, nsISupports **aSecurityInfo); \
  86.  
  87. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  88. #define NS_FORWARD_NSISOCKETPROVIDER(_to) \
  89.   NS_IMETHOD NewSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * *aFileDesc, nsISupports **aSecurityInfo) { return _to NewSocket(aFamily, aHost, aPort, aProxyHost, aProxyPort, aFlags, aFileDesc, aSecurityInfo); } \
  90.   NS_IMETHOD AddToSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * aFileDesc, nsISupports **aSecurityInfo) { return _to AddToSocket(aFamily, aHost, aPort, aProxyHost, aProxyPort, aFlags, aFileDesc, aSecurityInfo); } \
  91.  
  92. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  93. #define NS_FORWARD_SAFE_NSISOCKETPROVIDER(_to) \
  94.   NS_IMETHOD NewSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * *aFileDesc, nsISupports **aSecurityInfo) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewSocket(aFamily, aHost, aPort, aProxyHost, aProxyPort, aFlags, aFileDesc, aSecurityInfo); } \
  95.   NS_IMETHOD AddToSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * aFileDesc, nsISupports **aSecurityInfo) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddToSocket(aFamily, aHost, aPort, aProxyHost, aProxyPort, aFlags, aFileDesc, aSecurityInfo); } \
  96.  
  97. #if 0
  98. /* Use the code below as a template for the implementation class for this interface. */
  99.  
  100. /* Header file */
  101. class nsSocketProvider : public nsISocketProvider
  102. {
  103. public:
  104.   NS_DECL_ISUPPORTS
  105.   NS_DECL_NSISOCKETPROVIDER
  106.  
  107.   nsSocketProvider();
  108.  
  109. private:
  110.   ~nsSocketProvider();
  111.  
  112. protected:
  113.   /* additional members */
  114. };
  115.  
  116. /* Implementation file */
  117. NS_IMPL_ISUPPORTS1(nsSocketProvider, nsISocketProvider)
  118.  
  119. nsSocketProvider::nsSocketProvider()
  120. {
  121.   /* member initializers and constructor code */
  122. }
  123.  
  124. nsSocketProvider::~nsSocketProvider()
  125. {
  126.   /* destructor code */
  127. }
  128.  
  129. /* void newSocket (in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, out PRFileDescStar aFileDesc, out nsISupports aSecurityInfo); */
  130. NS_IMETHODIMP nsSocketProvider::NewSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * *aFileDesc, nsISupports **aSecurityInfo)
  131. {
  132.     return NS_ERROR_NOT_IMPLEMENTED;
  133. }
  134.  
  135. /* void addToSocket (in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, in PRFileDescStar aFileDesc, out nsISupports aSecurityInfo); */
  136. NS_IMETHODIMP nsSocketProvider::AddToSocket(PRInt32 aFamily, const char *aHost, PRInt32 aPort, const char *aProxyHost, PRInt32 aProxyPort, PRUint32 aFlags, struct PRFileDesc * aFileDesc, nsISupports **aSecurityInfo)
  137. {
  138.     return NS_ERROR_NOT_IMPLEMENTED;
  139. }
  140.  
  141. /* End of implementation class template. */
  142. #endif
  143.  
  144. /**
  145.  * nsISocketProvider implementations should be registered with XPCOM under a
  146.  * contract ID of the form: "@mozilla.org/network/socket;2?type=foo"
  147.  */
  148. #define NS_NETWORK_SOCKET_CONTRACTID_PREFIX \
  149.     "@mozilla.org/network/socket;2?type="
  150.  
  151. #endif /* __gen_nsISocketProvider_h__ */
  152.